package java9;
//矩形 直角三角形 倒直角三角形 等腰三角形 菱形
public class Code126 {
	public static void main(String[] args) {
		System.out.println("菱形");
		int rows1=19;
		for(int i=1;i<=rows1;i++){
			if(i<=10){
				for(int j=1;j<=(rows1+1)/2-i;j++){
					System.out.print(" "+" ");	
				}
				for(int j=1;j<=2*i-1;j++){
					System.out.print("*"+" ");
				}
			}
			else{
				for(int j=1;j<=i-(rows1+1)/2;j++){
					System.out.print(" "+" ");	
				}
				for(int j=1;j<=rows1-2*(i-(rows1+1)/2);j++){
					System.out.print("*"+" ");
				}	
			}
			System.out.println();
		}
		System.out.println("\n\n");

		System.out.println("直角三角形");
		int rows2=8;
		for(int i=1;i<=rows2;i++){
			for(int j=1;j<=i;j++){
				System.out.print("*"+" ");
			}
			System.out.print("\n");
		}
		System.out.println("\n\n");

		System.out.println("倒直角三角形");
		int rows4=8;
		for(int i=1;i<=rows4;i++){
			for(int j=1;j<=rows4+1-i;j++){
				System.out.print("*"+" ");
			}
			System.out.print("\n");
		}
		System.out.println("\n\n");

		System.out.println("矩形");
		int rows3=8;
		for(int i=1;i<=rows3;i++){
			for(int j=1;j<=rows3;j++){	
				System.out.print("*"+" ");
			}
			System.out.println();
		}
		System.out.println("\n\n");

		System.out.println("等腰三角形");
		int rows5=10;
		for(int i=1;i<=rows5;i++){
			for(int j=1;j<=rows5-i;j++){
				System.out.print(" "+" ");	
			}
			for(int j=1;j<=2*i-1;j++){
				System.out.print("*"+" ");	
			}
			System.out.println();
		}
		System.out.println("\n\n");

		System.out.println("空心菱形");
		int rows=19;
		for(int i=1;i<=rows;i++){
			if(i<=10){
				for(int j=1;j<=(rows+1)/2-i;j++){
					System.out.print(" "+" ");	
				}

				for(int j=1;j<=2*i-1;j++){
					if(j==1||j==2*i-1){
						System.out.print("*"+" ");
					}else{
						System.out.print(" "+" ");
					}	
				}


			}else{
				for(int j=1;j<=i-(rows+1)/2;j++){
					System.out.print(" "+" ");
				}
				for(int j=1;j<=rows-2*(i-(rows+1)/2);j++){
					if(j==1||j==rows-2*(i-(rows+1)/2)){
						System.out.print("*"+" ");
					}else{
						System.out.print(" "+" ");
					}
				}
			}
			System.out.println();
		}

	}

}
